<?php

// +----------------------------------------------------------------------
// | Apprh.Shop
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.apprh.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// +----------------------------------------------------------------------
// | Author: 雲溪荏苒 <290648237@qq.com>
// +----------------------------------------------------------------------

namespace app\common\model;

use service\ToolsService;
use think\Model;

/**
 * 产品分类模型
 * Class ProductClass
 * @package app\common\model
 * @author 雲溪荏苒 <290648237@qq.com>
 * @date 2017/12/10
 */
class ProductClass extends Model{


    public function getList($condition = [], $order='sort asc', $field='*', $curPage = 0, $pageSize = 0){
        if (!$curPage) {
            $curPage = request()->param('cur_page', 1);// 获取当前页码
        }

        $data = db("product_class")->field($field)->where($condition)->order($order)->page($curPage, $pageSize)->select();
//        $result = ToolsService::arr2tree($data, 'id');
        return $data;
    }

}














